<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
</head>
<body>
	<script type="text/javascript">
		var obj = {
			name : "abc",
			age : 123,
			card : ['visa','master'],
			wife : {
				name : "bcd",
				son : {
					name : "aaa"
				}
			}
		}

		var obj1 = {
			name : obj.name,
			age : 123,
			card : [] 建立新数组，进行数组对数组的再一次拷贝
		}
		1. 判断是不是原始值，原始值直接拷贝  typeof()  object  
		2. 引用只判断是数组还是对象  instanceof toString constructor
		3. 建立相应的数组或对象
		递归
		遍历对象 for(var prop in obj)

	</script>

	<script type="text/javascript">
		function deepClone(origin,target){
			var target = target || {},
			toStr = Object.prototype.toString,
			arrStr = "[array Object]";
		}
	</script>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
</head>
<body>
	//工具方法，放到工具库里
	<script type="text/javascript">
		function type(target){
			var template = {
				"[object Array]" = "array - Object",
				"[object Object]" = "object - Object",
				"[object Number]" = "number - Object",
				"[object Boolean]" = "boolean - Object", 
				"[object String]" = "string - Object"
			}
			if(target === null){
				return "null";//返回字符串类型Null
			}

			if(typeof(target) == 'function'){
				return 'function';
			}else if(typeof(target) == 'object'){//引用值判断类型是数组，对象，还是包装类 Object.prototype.toString
				var str = Object.prototype.toString.call(target);
				return template[str];//对象属性值的形式，取出对象的属性值
			}else{//原始值
				return typeof(target); 
			}
		}
	</script>
</body>
</html>